package com.oauth.extension.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class MainPanel extends Composite {

	private static MainPanelUiBinder uiBinder = GWT.create(MainPanelUiBinder.class);

	interface MainPanelUiBinder extends UiBinder<Widget, MainPanel> {
	}

	private static final ExtensionConstant extConstants = GWT.create(ExtensionConstant.class);
	private static final ChromeConstant crConstants = GWT.create(ChromeConstant.class);
	@UiField
	Label chromeName;

	@UiField
	Label chromeDescription;

	@UiField
	Image chromeImage;

	@UiField
	ExtensionPanel birthdayExt;

	@UiField
	ExtensionPanel statusExt;

	public MainPanel() {
		initWidget(uiBinder.createAndBindUi(this));

		chromeName.setText(crConstants.chromeName());
		chromeDescription.setText(crConstants.chromeDescription());
		chromeImage.setUrl(crConstants.chromeImageUrl());

		birthdayExt.setDetails(extConstants.birthdayName(), extConstants.birthdayDescription(),
				extConstants.birthdayImageUrl(), extConstants.birthdayExtUrl());
		statusExt.setDetails(extConstants.statusName(), extConstants.statusDescription(),
				extConstants.statusImageUrl(), extConstants.statusExtUrl());
	}

}
